Introduction to openAnalysis

In our daily life, we encounter many algorithms. Knowingly or Unknowingly, algorithms make our life easier. Analysis of algorithms is a special field of interest in Computer Science. Analysis evaluates the algorithm, and leads to invention of faster algorithms. Visualization leads to the better understanding of how algorithms work. The package openAnalysis is inteded as a tool for analyzing and visualizing algorithms.

Types of supported algorithms

The following types of algorithms are currently supported. We plan to support more kind of algorithms in the future.

  • Comparison based Sorting Algorithms ( Analysis + Visualization )
  • Comparison based Searching Algorithms ( Analysis )
  • Comparison based Pattern Matching Algorithms ( Analysis )
  • Data Structures and Related algorithms ( Visualization )
  • Graph Algorithms based on Tree Growth technique ( Visualizaiton )
  • Graph Algorithms utilizing Matrix and Dynamic Programming ( Visualization )

Setting up OpenAnalysis

openAnalysis is only supported on Python versions which are greater than 3.5. Once you have suitable version of Python installed, you can simply obtain openAnalysis via pip (or pip3, if you have multiple versions of Python installed)

sudo pip install openAnalysis

If all things go well, you have working installation of OpenAnalysis.

Inside the package

OpenAnalysis has following package structure.

openAnalysis/
├── base_data_structures.py            - Provides PriorityQueue and UnionFind data  structures
├── datastructures.py                  - Provides classes for Data Structure Visualization
├── matrix_animator.py                 - Provides classes for DP based Graph algorithms
├── searching.py                       - Provides classes for Sorting algorithms
├── sorting.py                         - Provides classes for Searching algorithms
├── string_matching.py                 - Provides classes for String Matching algorithms
└── tree_growth.py                     - Provides classes for Tree growth based Graph Algorithms

importing the modules

Since openAnalysis root does not have any executable as is, we will import methods from its modules. In further chapters, we shall see the purpose of every modules and shall use it.

key factor for analysis

In Computer Science, running time of algorithms is greately considered. Every alorithm solves the given instance of problem by performing some basic operation. The time taken by the algorithm is directly proportional to number of basic operations it has performed.

In normal working environment, time taken by the algorithm to solve a problem is affected by task scheduling performed by OS. We have to fit the obtained running time data in order to analyse the algorithm. Instead of using running time as a key for analysis, we will use number of basic operations as a key in openAnalysis.

This change in key factor implies, we have to adhere to a standard for implementing algorithms. In fact. OpenAnalysis provides such standards, either in the form of rules, or in the form of Base Classes. We shall see those rules in upcomming chapter. In future builds, we plan to include Time-based analysis also.